package com.ln.yygh.hosp.controller;

import com.ln.yygh.common.result.Result;
import com.ln.yygh.hosp.service.ScheduleService;
import com.ln.yygh.model.hosp.Schedule;
import io.swagger.annotations.*;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.*;

/**
 * @author: lianXiaoChen
 * @create: 2021-06-03 09:43
 */
@RestController
@RequestMapping("/admin/hosp/hospital")
@Api("排班详情")
public class ScheduleController {
    @Autowired
    private ScheduleService scheduleService;

    @ApiOperation("查询排班规则数据")
    @GetMapping("/getScheduleRule/{page}/{limit}/{hoscode}/{depcode}")
    public Result getScheduleRule(@PathVariable Integer page,
                                          @PathVariable Integer limit,
                                          @PathVariable String hoscode,
                                          @PathVariable String depcode){
        Map<String,Object> map = scheduleService.getRuleSchedule(page,limit,hoscode,depcode);
        return Result.ok(map);
    }
    //根据医院编号 科室编号   查询排版详情
    @ApiOperation("查询排班详细信息")
    @GetMapping("getScheduleDetail/{hoscode}/{depcode}/{workDate}")
    public Result getScheduleDetail(@PathVariable String hoscode,
                                    @PathVariable String depcode,
                                    @PathVariable String workDate){
        List<Schedule> list = scheduleService.getDetailSchedule(hoscode,depcode,workDate);
        return Result.ok(list);

    }



}
